<?php
namespace app\common\validate;

use think\Validate;

class Product extends Validate
{
    protected $rule = [
        'name'  =>  'require',
        'type' =>  'in:1,2',
        'unit' =>  'require',
        'keyword' =>  'require',
        'category_id' =>  'gt:0',
        'brand_id' =>  'gt:0',

    ];

    protected $message = [
        'name.require' => '产品名不能为空',
        'unit.require' => '单位不能为空',
        'keyword.require' => '关键字不能为空',
        'category_id.gt' => '请选择分类',
        'brand_id.gt' => '请选择品牌',
        'type.in' => '请选择产品类型'
    ];

}